<style lang="less">
@import "./home.less";
@import "../../styles/common.less";
</style>
<template>
  <div>
    <!-- class="home"   v-show="currNav == 'freight'" 控制了首页内容展示隐藏 利用权限名称-->
    <div v-if="loginRole.userType == '2'" class="home">
      <platformHome> </platformHome>
    </div>
    <div v-if="loginRole.userType != '2'" class="home">
      <ownerHome> </ownerHome>
    </div>
  </div>
</template>

<script>
import { customerService } from "@/api/index";
// 资讯投诉
import platformHome from "./platformHome.vue";
import ownerHome from "./ownerHome.vue";
export default {
  name: "home",
  components: {
    platformHome,
    ownerHome,
  },
  data() {
    return {
      loginRole: {},
    };
  },
  computed: {},
  methods: {},
  created() {
    this.loginRole = JSON.parse(localStorage.getItem("userInfo"));
  },
  mounted() {
    customerService().then((res) => {
      if (res.result.isDisplay == "1") {
        window.localStorage.setItem("stateShow", JSON.stringify(true));
      }else if (res.result.isDisplay == "0") {
        window.localStorage.setItem("stateShow", JSON.stringify(false));
      }else{
         window.localStorage.setItem("stateShow", JSON.stringify(false));
      }
      
    });
    // 通知
    let noticeFlag = "noticeShowed";
    let notice = Cookies.get(noticeFlag);
    if (notice != noticeFlag) {
      // this.showNotice();
      Cookies.set(noticeFlag, noticeFlag);
    }
  },
};
</script>

<style  lang="less">
.listItem {
  padding: 5px 0 15px 0;
  font-size: 16px;
  border-bottom: 1px #333 dotted;
}
.commentsItem {
  font-size: 14px;
}
.AlertcommentsItem {
  font-size: 14px;
  margin: 2px 0;
}

.commentsBox {
  margin-bottom: 7px;

  .ivu-card {
    .ivu-card-body {
      padding: 6px 16px !important;
    }
  }
}
.Cardbox {
  .ivu-card {
    .ivu-card-body {
      padding-top: 7px !important;
    }
  }
}
</style>